package com.sjh.application

import com.sjh.application.ApplicationInjectInterface
import com.sjh.application.Consts

/**
 *
 * @author Extends
 * @date 2020/6/19
 */
object Utils {
    fun genCode(module:String?,name:String,path:String) : Pair<String,String>{
        val className = "${if(module!=null) ("$module$$") else ""}$name${'$'}${'$'}Inject"
        return "${Consts.PACKAGE}.$className" to """
        package ${Consts.PACKAGE};
        import java.util.ArrayList;
        import ${ApplicationInjectInterface::class.java.`package`.name}.${ApplicationInjectInterface::class.java.simpleName};

        public class $className implements ${ApplicationInjectInterface::class.java.simpleName}{
        
            @Override
            public void init(ArrayList<String> list){
                list.add("$path");
            }
        }
    """.trimIndent()
    }
}